package com.xyy.saas.payment.common.enums;

/**
 * @author chenshuyi
 * @date 2019/11/6 17:27
 */
public enum ChannelEnum {
    /**
     * 不用了
     */
    ALIPAY("alipay", "alipay", "支付宝 App 支付"),
    ALIPAY_QR("alipay_qr", "alipay_qr", "支付宝扫码支付"),
    WX("wx", "wx", "微信 App 支付"),
    WX_PUB_QR("wx_pub_qr", "wx_pub_qr", "微信 Native 支付"),
    UPACP("upacp", "upacp", "银联手机控件支付（银联 App 支付）"),
    UPACP_PC("upacp_pc", "upacp_pc", "银联网关支付（银联 PC 网页支付）");

    private String xyy;
    private String pingxx;
    private String desc;

    ChannelEnum(String xyy, String pingxx, String desc) {
        this.xyy = xyy;
        this.pingxx = pingxx;
        this.desc = desc;
    }

    public String getPingxxVaule() {
        return this.pingxx;
    }

    public String getXyyVaule() {
        return this.xyy;
    }

    public static String getPingxxByXyy(String xyy) {
        for(ChannelEnum channelEnum : ChannelEnum.values()) {
            if(channelEnum.xyy.equals(xyy)) {
                return channelEnum.pingxx;
            }
        }
        return null;
    }

}
